package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.ArticleAddDTO;
import org.jsola.hr.dto.ArticleUpdateDTO;
import org.jsola.hr.query.ArticleQuery;
import org.jsola.hr.vo.ArticleListVO;
import org.jsola.hr.vo.ArticleVO;

import java.util.List;

/**
 * 人力文章
 *
 * @author zhr
 */
@Api(tags = "hr-人力文章")
public interface IArticleControllerAPI {

    /**
     * 新增人力文章
     * @param articleAddDTO 人力文章新增实体
     * @return 人力文章展示对象
     */
    @ApiOperation(value = "新增人力文章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleAddDTO", dataType = "ArticleAddDTO", value = "新增人力文章", paramType = "body")
    })
    Result<ArticleVO> save(ArticleAddDTO articleAddDTO);


    /**
     * 修改人力文章
     * @param articleUpdateDTO 人力文章
     * @return 更新数量
     */
    @ApiOperation(value = "修改人力文章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleUpdateDTO", dataType = "ArticleUpdateDTO", value = "修改人力文章", paramType = "body")
    })
    Result<Integer> update(ArticleUpdateDTO articleUpdateDTO);




    /**
     * 删除单个人力文章，彻底删除
     * @param articleId 人力文章id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个人力文章，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleId", dataType = "Long", value = "人力文章id", paramType = "path")
    })
    Result<Integer> delete(Long articleId);


    /**
     * 批量删除人力文章，彻底删除
     * @param articleIds 人力文章id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除人力文章，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleIds", dataType = "Long[]", value = "人力文章id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] articleIds);


    /**
     * 根据人力文章id查询人力文章详情
     * @param articleId 人力文章id
     * @return 人力文章详情
     */
    @ApiOperation(value="根据人力文章id查询人力文章详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleId", dataType = "Long", value = "人力文章id", paramType = "path")
    })
    Result<ArticleVO> findById(Long articleId);


    /**
     * 查询人力文章
     * @param articleQuery 人力文章查询参数
     * @return page
     */
    @ApiOperation(value="查询人力文章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleQuery", dataType = "ArticleQuery", value = "人力文章查询参数", paramType = "query")
    })
    Result<List<ArticleListVO>> listAll(ArticleQuery articleQuery);


     /**
     * 分页查询人力文章
     * @param articleQuery 人力文章查询参数
     * @return page
     */
    @ApiOperation(value="分页查询人力文章")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "articleQuery", dataType = "ArticleQuery", value = "人力文章查询参数", paramType = "query")
    })
    Result<Page<ArticleListVO>> page(ArticleQuery articleQuery);


}

